#include <iostream>
#include "WanderSock.h"

int main()
{

	WL_StartLog(true);

	short a = -1;
	unsigned short b = (unsigned short)a;
	short c = (short)b;

	std::cout<<c<<std::endl;

	/*
	WL_WriteLog(WL_LEVEL_LOG, "test");
	WL_WriteLog(WL_LEVEL_WARNING, "load fail");

	CWanderMessage msg;

	//char buf[2048];
	msg.BeginWrite();

	msg.WriteByte('h');

	msg.WriteFloat(3.14f);
	msg.WriteShort(5);

	msg.WriteByte('\0');

	msg.BeginRead();

	char c = msg.ReadByte();
	float f = msg.ReadFloat();
	short s = msg.ReadShort();
	WL_WriteLog(WL_LEVEL_LOG, "%c, %f, %d",c, f, s);

	CWanderClient client;

	client.SetupClientSide("127.0.0.1", "127.0.0.1", 9090);

	CWanderServer server;

	server.Init("127.0.0.1", 9090);

	sockaddr_in addr;

	addr.sin_family = AF_INET;
	addr.sin_port = htons(9090);
	addr.sin_addr.s_addr = inet_addr("127.0.0.1");
	server.AddClient(*(sockaddr*)&addr, "No.1");
	//server.AddClient(addr, "No.2");

	server.RemoveClient(server.GetClient(0));
	//server.RemoveClient(server.GetClient(1));
	*/

	system("pause");
	WL_StopLog();
	return 1;
}

